package cn.com.dcsgo.common.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * 不为 null 时不允许为空白字符串
 *
 * @author Dcsgo
 * @since 23/5/2025 下午 2:27
 */
@Documented
@Constraint(validatedBy = NotBlankIfNotNullValidator.class)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface NotBlankIfNotNull {
    String message() default "内容不能全为空白";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
